package com.kuaimacode.kframework.mybatis.models.user;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * @author 12786 on 2019/3/23.
 * @version 1.0
 */
@Data
public class UserAccountDetail implements Serializable {

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "id")
    @TableId(value = "id", type = IdType.AUTO)

    private Long id;

    @TableId("user_id")
    @ApiModelProperty(value = "用户ID")
    private Long userId;

    @TableId("account_type")
    @ApiModelProperty(value = "账户类型 1 余额账户 2 代收款账户")
    private String accountType;

    @TableId("detail_type")
    @ApiModelProperty(value = "明细类型1支出2入账")
    private String detailType;

    @ApiModelProperty(value = "金额")
    @TableId("amount")
    private String amount;

    @ApiModelProperty(value = "出入账类型:1基本入账2基本出账3奖励4罚款")
    @TableId("in_out_type")
    private String inOutType;

    @ApiModelProperty(value = "账户入账出账途径1微信2支付宝3银行卡")
    @TableId("accout_way")
    private Long accoutWay;

    @ApiModelProperty(value = "交易描述")
    @TableId("tran_desc")
    private String tranDesc;

    @ApiModelProperty(value = "数据状态1无效 0有效")
    @TableId("status")
    private String status;

    @ApiModelProperty(value = "交易时间")
    @TableField("create_dt")
    private Date createDt;

    @ApiModelProperty(value = "更新时间")
    @TableField("update_dt")
    private Date updateDt;


    @ApiModelProperty(value = "交易流水号")
    @TableField("out_trade_no")
    private String outTradeNo;

    @ApiModelProperty(value = "交易后余额")
    @TableId("tran_amount")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "##0.00") //精度保留2位小数
    private BigDecimal tranAmount;
}
